package cn.liontalk.utils;

import cn.liontalk.entity.Order;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;

/**
 * @author ZhouZhe
 * @version 1.0
 * @description fastjson的工具类
 * @date 2018-12-13 21:10
 **/
public class FastJsonConvertUtil {



    public static Order convertJSONToObject(String message, Object obj){
        Order order = JSON.parseObject(message, new TypeReference<Order>() {});
        return order;
    }

    public static String convertObjectToJSON(Object obj){
        String text = JSON.toJSONString(obj);
        return text;
    }


}
